/**
 * 为了兼容非h5端,修改了两行代码
 * 搜索: jl ---start
 */
var e, n, r = function() {
	function e() {
		this.events = void 0, this.events = {}
	}
	var n = e.prototype;
	return n.emit = function(e, n) {
		return this.events[e] && this.events[e].forEach(function(e) {
			return e(n)
		}), this
	}, n.on = function(e, n) {
		return this.events[e] ? this.events[e].push(n) : this.events[e] = [n], this
	}, n.off = function(e, n) {
		if (e && "function" == typeof n) {
			var r = this.events[e],
				t = r.findIndex(function(e) {
					return e === n
				});
			r.splice(t, 1)
		} else this.events[e] = [];
		return this
	}, e
}();

function t() {
	return t = Object.assign || function(e) {
		for (var n = 1; n < arguments.length; n++) {
			var r = arguments[n];
			for (var t in r) Object.prototype.hasOwnProperty.call(r, t) && (e[t] = r[t])
		}
		return e
	}, t.apply(this, arguments)
}

function i(e, n) {
	return i = Object.setPrototypeOf || function(e, n) {
		return e.__proto__ = n, e
	}, i(e, n)
}! function(e) {
	e.INITSDK = "InitSDK", e.LOGIN = "Login", e.LOGOUT = "Logout", e.GETLOGINSTATUS = "GetLoginStatus", e.GETLOGINUSER =
		"GetLoginUser", e.GETSELFUSERINFO = "GetSelfUserInfo", e.CREATETEXTMESSAGE = "CreateTextMessage", e
		.CREATETEXTATMESSAGE = "CreateTextAtMessage", e.CREATEADVANCEDTEXTMESSAGE = "CreateAdvancedTextMessage", e
		.CREATEIMAGEMESSAGEFROMBYURL = "CreateImageMessageByURL", e.CREATESOUNDMESSAGEBYURL = "CreateSoundMessageByURL",
		e.CREATEVIDEOMESSAGEBYURL = "CreateVideoMessageByURL", e.CREATEFILEMESSAGEBYURL = "CreateFileMessageByURL", e
		.CREATEIMAGEMESSAGEFROMFULLPATH = "CreateImageMessageFromFullPath", e.CREATESOUNDMESSAGEFROMFULLPATH =
		"CreateSoundMessageFromFullPath", e.CREATEVIDEOMESSAGEFROMFULLPATH = "CreateVideoMessageFromFullPath", e
		.CREATEFILEMESSAGEFROMFULLPATH = "CreateFileMessageFromFullPath", e.CREATELOCATIONMESSAGE =
		"CreateLocationMessage", e.CREATECUSTOMMESSAGE = "CreateCustomMessage", e.CREATEMERGERMESSAGE =
		"CreateMergerMessage", e.CREATEFORWARDMESSAGE = "CreateForwardMessage", e.CREATEQUOTEMESSAGE =
		"CreateQuoteMessage", e.CREATEADVANCEDQUOTEMESSAGE = "CreateAdvancedQuoteMessage", e.CREATECARDMESSAGE =
		"CreateCardMessage", e.CREATEFACEMESSAGE = "CreateFaceMessage", e.SENDMESSAGE = "SendMessage", e
		.SENDMESSAGENOTOSS = "SendMessageNotOss", e.GETHISTORYMESSAGELIST = "GetHistoryMessageList", e
		.GETADVANCEDHISTORYMESSAGELIST = "GetAdvancedHistoryMessageList", e.GETHISTORYMESSAGELISTREVERSE =
		"GetHistoryMessageListReverse", e.REVOKEMESSAGE = "RevokeMessage", e.SETONECONVERSATIONPRIVATECHAT =
		"SetOneConversationPrivateChat", e.DELETEMESSAGEFROMLOCALSTORAGE = "DeleteMessageFromLocalStorage", e
		.DELETEMESSAGEFROMLOCALANDSVR = "DeleteMessageFromLocalAndSvr", e.DELETECONVERSATIONFROMLOCALANDSVR =
		"DeleteConversationFromLocalAndSvr", e.DELETEALLCONVERSATIONFROMLOCAL = "DeleteAllConversationFromLocal", e
		.DELETEALLMSGFROMLOCALANDSVR = "DeleteAllMsgFromLocalAndSvr", e.DELETEALLMSGFROMLOCAL = "DeleteAllMsgFromLocal",
		e.MARKSINGLEMESSAGEHASREAD = "MarkSingleMessageHasRead", e.INSERTSINGLEMESSAGETOLOCALSTORAGE =
		"InsertSingleMessageToLocalStorage", e.INSERTGROUPMESSAGETOLOCALSTORAGE = "InsertGroupMessageToLocalStorage", e
		.TYPINGSTATUSUPDATE = "TypingStatusUpdate", e.MARKC2CMESSAGEASREAD = "MarkC2CMessageAsRead", e
		.MARKMESSAGEASREADBYCONID = "MarkMessageAsReadByConID", e.CLEARC2CHISTORYMESSAGE = "ClearC2CHistoryMessage", e
		.CLEARC2CHISTORYMESSAGEFROMLOCALANDSVR = "ClearC2CHistoryMessageFromLocalAndSvr", e.CLEARGROUPHISTORYMESSAGE =
		"ClearGroupHistoryMessage", e.CLEARGROUPHISTORYMESSAGEFROMLOCALANDSVR =
		"ClearGroupHistoryMessageFromLocalAndSvr", e.ADDFRIEND = "AddFriend", e.SEARCHFRIENDS = "SearchFriends", e
		.GETDESIGNATEDFRIENDSINFO = "GetDesignatedFriendsInfo", e.GETRECVFRIENDAPPLICATIONLIST =
		"GetRecvFriendApplicationList", e.GETSENDFRIENDAPPLICATIONLIST = "GetSendFriendApplicationList", e
		.GETFRIENDLIST = "GetFriendList", e.SETFRIENDREMARK = "SetFriendRemark", e.ADDBLACK = "AddBlack", e
		.GETBLACKLIST = "GetBlackList", e.REMOVEBLACK = "RemoveBlack", e.CHECKFRIEND = "CheckFriend", e
		.ACCEPTFRIENDAPPLICATION = "AcceptFriendApplication", e.REFUSEFRIENDAPPLICATION = "RefuseFriendApplication", e
		.DELETEFRIEND = "DeleteFriend", e.GETUSERSINFO = "GetUsersInfo", e.SETSELFINFO = "SetSelfInfo", e
		.GETALLCONVERSATIONLIST = "GetAllConversationList", e.GETCONVERSATIONLISTSPLIT = "GetConversationListSplit", e
		.GETONECONVERSATION = "GetOneConversation", e.GETCONVERSATIONIDBYSESSIONTYPE = "GetConversationIDBySessionType",
		e.GETMULTIPLECONVERSATION = "GetMultipleConversation", e.DELETECONVERSATION = "DeleteConversation", e
		.SETCONVERSATIONDRAFT = "SetConversationDraft", e.PINCONVERSATION = "PinConversation", e
		.GETTOTALUNREADMSGCOUNT = "GetTotalUnreadMsgCount", e.GETCONVERSATIONRECVMESSAGEOPT =
		"GetConversationRecvMessageOpt", e.SETCONVERSATIONRECVMESSAGEOPT = "SetConversationRecvMessageOpt", e
		.SEARCHLOCALMESSAGES = "SearchLocalMessages", e.MARKGROUPMESSAGEHASREAD = "MarkGroupMessageHasRead", e
		.MARKGROUPMESSAGEASREAD = "MarkGroupMessageAsRead", e.INVITEUSERTOGROUP = "InviteUserToGroup", e
		.KICKGROUPMEMBER = "KickGroupMember", e.GETGROUPMEMBERSINFO = "GetGroupMembersInfo", e.GETGROUPMEMBERLIST =
		"GetGroupMemberList", e.GETGROUPMEMBERLISTBYJOINTIMEFILTER = "GetGroupMemberListByJoinTimeFilter", e
		.SEARCHGROUPMEMBERS = "SearchGroupMembers", e.SETGROUPAPPLYMEMBERFRIEND = "SetGroupApplyMemberFriend", e
		.SETGROUPLOOKMEMBERINFO = "SetGroupLookMemberInfo", e.GETJOINEDGROUPLIST = "GetJoinedGroupList", e.CREATEGROUP =
		"CreateGroup", e.SETGROUPINFO = "SetGroupInfo", e.SETGROUPMEMBERNICKNAME = "SetGroupMemberNickname", e
		.GETGROUPSINFO = "GetGroupsInfo", e.JOINGROUP = "JoinGroup", e.SEARCHGROUPS = "SearchGroups", e.QUITGROUP =
		"QuitGroup", e.DISMISSGROUP = "DismissGroup", e.CHANGEGROUPMUTE = "ChangeGroupMute", e.CHANGEGROUPMEMBERMUTE =
		"ChangeGroupMemberMute", e.TRANSFERGROUPOWNER = "TransferGroupOwner", e.GETSENDGROUPAPPLICATIONLIST =
		"GetSendGroupApplicationList", e.GETRECVGROUPAPPLICATIONLIST = "GetRecvGroupApplicationList", e
		.ACCEPTGROUPAPPLICATION = "AcceptGroupApplication", e.REFUSEGROUPAPPLICATION = "RefuseGroupApplication", e
		.SIGNAL_INGINVITE = "SignalingInvite", e.SIGNALINGINVITEINGROUP = "SignalingInviteInGroup", e.SIGNALINGACCEPT =
		"SignalingAccept", e.SIGNALINGREJECT = "SignalingReject", e.SIGNALINGCANCEL = "SignalingCancel", e
		.SIGNALINGHUNGUP = "SignalingHungUp", e.GETSUBDEPARTMENT = "GetSubDepartment", e.GETDEPARTMENTMEMBER =
		"GetDepartmentMember", e.GETUSERINDEPARTMENT = "GetUserInDepartment", e.GETDEPARTMENTMEMBERANDSUBDEPARTMENT =
		"GetDepartmentMemberAndSubDepartment", e.GETDEPARTMENTINFO = "GetDepartmentInfo", e.SEARCHORGANIZATION =
		"SearchOrganization", e.RESETCONVERSATIONGROUPATTYPE = "ResetConversationGroupAtType", e
		.SETGROUPMEMBERROLELEVEL = "SetGroupMemberRoleLevel", e.SETGROUPVERIFICATION = "SetGroupVerification", e
		.SETGLOBALRECVMESSAGEOPT = "SetGlobalRecvMessageOpt", e.NEWREVOKEMESSAGE = "NewRevokeMessage", e
		.FINDMESSAGELIST = "FindMessageList"
}(e || (e = {})),
function(e) {
	e.ONCONNECTFAILED = "OnConnectFailed", e.ONCONNECTSUCCESS = "OnConnectSuccess", e.ONCONNECTING = "OnConnecting", e
		.ONKICKEDOFFLINE = "OnKickedOffline", e.ONSELFINFOUPDATED = "OnSelfInfoUpdated", e.ONUSERTOKENEXPIRED =
		"OnUserTokenExpired", e.ONPROGRESS = "OnProgress", e.ONRECVNEWMESSAGE = "OnRecvNewMessage", e
		.ONRECVNEWMESSAGES = "OnRecvNewMessages", e.ONRECVMESSAGEREVOKED = "OnRecvMessageRevoked", e
		.ONRECVC2CREADRECEIPT = "OnRecvC2CReadReceipt", e.ONRECVGROUPREADRECEIPT = "OnRecvGroupReadReceipt", e
		.ONCONVERSATIONCHANGED = "OnConversationChanged", e.ONNEWCONVERSATION = "OnNewConversation", e
		.ONSYNCSERVERFAILED = "OnSyncServerFailed", e.ONSYNCSERVERFINISH = "OnSyncServerFinish", e.ONSYNCSERVERSTART =
		"OnSyncServerStart", e.ONTOTALUNREADMESSAGECOUNTCHANGED = "OnTotalUnreadMessageCountChanged", e.ONBLACKADDED =
		"OnBlackAdded", e.ONBLACKDELETED = "OnBlackDeleted", e.ONFRIENDAPPLICATIONACCEPTED =
		"OnFriendApplicationAccepted", e.ONFRIENDAPPLICATIONADDED = "OnFriendApplicationAdded", e
		.ONFRIENDAPPLICATIONDELETED = "OnFriendApplicationDeleted", e.ONFRIENDAPPLICATIONREJECTED =
		"OnFriendApplicationRejected", e.ONFRIENDINFOCHANGED = "OnFriendInfoChanged", e.ONFRIENDADDED = "OnFriendAdded",
		e.ONFRIENDDELETED = "OnFriendDeleted", e.ONJOINEDGROUPADDED = "OnJoinedGroupAdded", e.ONJOINEDGROUPDELETED =
		"OnJoinedGroupDeleted", e.ONGROUPMEMBERADDED = "OnGroupMemberAdded", e.ONGROUPMEMBERDELETED =
		"OnGroupMemberDeleted", e.ONGROUPAPPLICATIONADDED = "OnGroupApplicationAdded", e.ONGROUPAPPLICATIONDELETED =
		"OnGroupApplicationDeleted", e.ONGROUPINFOCHANGED = "OnGroupInfoChanged", e.ONGROUPMEMBERINFOCHANGED =
		"OnGroupMemberInfoChanged", e.ONGROUPAPPLICATIONACCEPTED = "OnGroupApplicationAccepted", e
		.ONGROUPAPPLICATIONREJECTED = "OnGroupApplicationRejected", e.ONRECEIVENEWINVITATION = "OnReceiveNewInvitation",
		e.ONINVITEEACCEPTED = "OnInviteeAccepted", e.ONINVITEEREJECTED = "OnInviteeRejected", e.ONINVITATIONCANCELLED =
		"OnInvitationCancelled", e.ONHANGUP = "OnHangUp", e.ONINVITATIONTIMEOUT = "OnInvitationTimeout", e
		.ONINVITEEACCEPTEDBYOTHERDEVICE = "OnInviteeAcceptedByOtherDevice", e.ONINVITEEREJECTEDBYOTHERDEVICE =
		"OnInviteeRejectedByOtherDevice", e.ONORGANIZATIONUPDATED = "OnOrganizationUpdated", e
		.ONRECVNEWMESSAGEFROMOTHERWEB = "OnRecvNewMessageFromOtherWeb", e.ONNEWRECVMESSAGEREVOKED =
		"OnNewRecvMessageRevoked"
}(n || (n = {}));
var o = function(e) {
		try {
			e && e.terminate()
		} catch (e) {
			console.log(e)
		}
	},
	a = function(e) {
		return (36 * Math.random()).toString(36).slice(2) + (new Date).getTime().toString() + e
	},
	u = function(r) {
		var u, s;

		function E() {
			var i;
			return (i = r.call(this) || this).ws = void 0, i.uid = void 0, i.token = void 0, i.platform = "web", i
				.wsUrl = "", i.lock = !1, i.logoutFlag = !1, i.ws2promise = {}, i.onceFlag = !0, i.timer = void 0, i
				.lastTime = 0, i.heartbeatCount = 0, i.heartbeatStartTime = 0, i.platformID = 0, i.isBatch = !1, i
				.worker = null, i.getLoginStatus = function(n) {
					return new Promise(function(r, t) {
						var o = n || a(i.uid);
						i.wsSend({
							reqFuncName: e.GETLOGINSTATUS,
							operationID: o,
							userID: i.uid,
							data: ""
						}, r, t)
					})
				}, i.getLoginUser = function(n) {
					return new Promise(function(r, t) {
						var o = n || a(i.uid);
						i.wsSend({
							reqFuncName: e.GETLOGINUSER,
							operationID: o,
							userID: i.uid,
							data: ""
						}, r, t)
					})
				}, i.getSelfUserInfo = function(n) {
					return new Promise(function(r, t) {
						var o = n || a(i.uid);
						i.wsSend({
							reqFuncName: e.GETSELFUSERINFO,
							operationID: o,
							userID: i.uid,
							data: ""
						}, r, t)
					})
				}, i.getUsersInfo = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.GETUSERSINFO,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.setSelfInfo = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.SETSELFINFO,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.createTextMessage = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.CREATETEXTMESSAGE,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.createTextAtMessage = function(n, r) {
					return new Promise(function(o, u) {
						var s = t({}, n);
						s.atUserIDList = JSON.stringify(s.atUserIDList), s.atUsersInfo = JSON.stringify(s
							.atUsersInfo);
						var E = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.CREATETEXTATMESSAGE,
							operationID: E,
							userID: i.uid,
							data: s
						}, o, u)
					})
				}, i.createAdvancedTextMessage = function(n, r) {
					return new Promise(function(o, u) {
						var s = t({}, n);
						s.messageEntityList = JSON.stringify(s.messageEntityList);
						var E = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.CREATEADVANCEDTEXTMESSAGE,
							operationID: E,
							userID: i.uid,
							data: s
						}, o, u)
					})
				}, i.createImageMessage = function(n, r) {
					return new Promise(function(o, u) {
						var s = r || a(i.uid),
							E = t({}, n);
						E.bigPicture = JSON.stringify(E.bigPicture), E.snapshotPicture = JSON.stringify(E
							.snapshotPicture), E.sourcePicture = JSON.stringify(E.sourcePicture);
						var d = {
							reqFuncName: e.CREATEIMAGEMESSAGEFROMBYURL,
							operationID: s,
							userID: i.uid,
							data: JSON.stringify(E)
						};
						i.wsSend(d, o, u)
					})
				}, i.createSoundMessage = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid),
							s = {
								soundBaseInfo: JSON.stringify(n)
							},
							E = {
								reqFuncName: e.CREATESOUNDMESSAGEBYURL,
								operationID: u,
								userID: i.uid,
								data: JSON.stringify(s)
							};
						i.wsSend(E, t, o)
					})
				}, i.createVideoMessage = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid),
							s = {
								videoBaseInfo: JSON.stringify(n)
							},
							E = {
								reqFuncName: e.CREATEVIDEOMESSAGEBYURL,
								operationID: u,
								userID: i.uid,
								data: JSON.stringify(s)
							};
						i.wsSend(E, t, o)
					})
				}, i.createFileMessage = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid),
							s = {
								fileBaseInfo: JSON.stringify(n)
							},
							E = {
								reqFuncName: e.CREATEFILEMESSAGEBYURL,
								operationID: u,
								userID: i.uid,
								data: JSON.stringify(s)
							};
						i.wsSend(E, t, o)
					})
				}, i.createFileMessageFromFullPath = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.CREATEFILEMESSAGEFROMFULLPATH,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.createImageMessageFromFullPath = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.CREATEIMAGEMESSAGEFROMFULLPATH,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.createSoundMessageFromFullPath = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.CREATESOUNDMESSAGEFROMFULLPATH,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.createVideoMessageFromFullPath = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.CREATEVIDEOMESSAGEFROMFULLPATH,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.createMergerMessage = function(n, r) {
					return new Promise(function(o, u) {
						var s = r || a(i.uid),
							E = t({}, n);
						E.messageList = JSON.stringify(n.messageList), E.summaryList = JSON.stringify(n
							.summaryList), i.wsSend({
							reqFuncName: e.CREATEMERGERMESSAGE,
							operationID: s,
							userID: i.uid,
							data: E
						}, o, u)
					})
				}, i.createForwardMessage = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.CREATEFORWARDMESSAGE,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.createFaceMessage = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.CREATEFACEMESSAGE,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.createLocationMessage = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.CREATELOCATIONMESSAGE,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.createCustomMessage = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.CREATECUSTOMMESSAGE,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.createQuoteMessage = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.CREATEQUOTEMESSAGE,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.createAdvancedQuoteMessage = function(n, r) {
					return new Promise(function(o, u) {
						var s = r || a(i.uid),
							E = t({}, n);
						E.messageEntityList = JSON.stringify(E.messageEntityList), i.wsSend({
							reqFuncName: e.CREATEADVANCEDQUOTEMESSAGE,
							operationID: s,
							userID: i.uid,
							data: E
						}, o, u)
					})
				}, i.createCardMessage = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.CREATECARDMESSAGE,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.sendMessage = function(n, r) {
					return new Promise(function(o, u) {
						var s = r || a(i.uid),
							E = t({}, n);
						E.offlinePushInfo = E.offlinePushInfo ? JSON.stringify(n.offlinePushInfo) : "", i
							.wsSend({
								reqFuncName: e.SENDMESSAGE,
								operationID: s,
								userID: i.uid,
								data: E
							}, o, u)
					})
				}, i.sendMessageNotOss = function(n, r) {
					return new Promise(function(o, u) {
						var s = r || a(i.uid),
							E = t({}, n);
						E.offlinePushInfo = E.offlinePushInfo ? JSON.stringify(n.offlinePushInfo) : "", i
							.wsSend({
								reqFuncName: e.SENDMESSAGENOTOSS,
								operationID: s,
								userID: i.uid,
								data: E
							}, o, u)
					})
				}, i.getHistoryMessageList = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.GETHISTORYMESSAGELIST,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.getAdvancedHistoryMessageList = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.GETADVANCEDHISTORYMESSAGELIST,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.getHistoryMessageListReverse = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.GETHISTORYMESSAGELISTREVERSE,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.revokeMessage = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.REVOKEMESSAGE,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.setOneConversationPrivateChat = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.SETONECONVERSATIONPRIVATECHAT,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.deleteMessageFromLocalStorage = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.DELETEMESSAGEFROMLOCALSTORAGE,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.deleteMessageFromLocalAndSvr = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.DELETEMESSAGEFROMLOCALANDSVR,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.deleteConversationFromLocalAndSvr = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.DELETECONVERSATIONFROMLOCALANDSVR,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.deleteAllConversationFromLocal = function(n) {
					return new Promise(function(r, t) {
						var o = n || a(i.uid);
						i.wsSend({
							reqFuncName: e.DELETEALLCONVERSATIONFROMLOCAL,
							operationID: o,
							userID: i.uid,
							data: ""
						}, r, t)
					})
				}, i.deleteAllMsgFromLocal = function(n) {
					return new Promise(function(r, t) {
						var o = n || a(i.uid);
						i.wsSend({
							reqFuncName: e.DELETEALLMSGFROMLOCAL,
							operationID: o,
							userID: i.uid,
							data: ""
						}, r, t)
					})
				}, i.deleteAllMsgFromLocalAndSvr = function(n) {
					return new Promise(function(r, t) {
						var o = n || a(i.uid);
						i.wsSend({
							reqFuncName: e.DELETEALLMSGFROMLOCALANDSVR,
							operationID: o,
							userID: i.uid,
							data: ""
						}, r, t)
					})
				}, i.markGroupMessageHasRead = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.MARKGROUPMESSAGEHASREAD,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.markGroupMessageAsRead = function(n, r) {
					return new Promise(function(o, u) {
						var s = r || a(i.uid),
							E = t({}, n);
						E.msgIDList = JSON.stringify(E.msgIDList), i.wsSend({
							reqFuncName: e.MARKGROUPMESSAGEASREAD,
							operationID: s,
							userID: i.uid,
							data: E
						}, o, u)
					})
				}, i.insertSingleMessageToLocalStorage = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.INSERTSINGLEMESSAGETOLOCALSTORAGE,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.insertGroupMessageToLocalStorage = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.INSERTGROUPMESSAGETOLOCALSTORAGE,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.typingStatusUpdate = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.TYPINGSTATUSUPDATE,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.markC2CMessageAsRead = function(n, r) {
					return new Promise(function(o, u) {
						var s = t({}, n);
						s.msgIDList = JSON.stringify(s.msgIDList);
						var E = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.MARKC2CMESSAGEASREAD,
							operationID: E,
							userID: i.uid,
							data: s
						}, o, u)
					})
				}, i.markNotifyMessageHasRead = function(e, n) {
					i.markMessageAsReadByConID({
						conversationID: e,
						msgIDList: []
					})
				}, i.markMessageAsReadByConID = function(n, r) {
					return new Promise(function(o, u) {
						var s = t({}, n);
						s.msgIDList = JSON.stringify(s.msgIDList);
						var E = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.MARKMESSAGEASREADBYCONID,
							operationID: E,
							userID: i.uid,
							data: s
						}, o, u)
					})
				}, i.clearC2CHistoryMessage = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.CLEARC2CHISTORYMESSAGE,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.clearC2CHistoryMessageFromLocalAndSvr = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.CLEARC2CHISTORYMESSAGEFROMLOCALANDSVR,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.clearGroupHistoryMessage = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.CLEARGROUPHISTORYMESSAGE,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.clearGroupHistoryMessageFromLocalAndSvr = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.CLEARGROUPHISTORYMESSAGEFROMLOCALANDSVR,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.getAllConversationList = function(n) {
					return new Promise(function(r, t) {
						var o = n || a(i.uid);
						i.wsSend({
							reqFuncName: e.GETALLCONVERSATIONLIST,
							operationID: o,
							userID: i.uid,
							data: ""
						}, r, t)
					})
				}, i.getConversationListSplit = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.GETCONVERSATIONLISTSPLIT,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.getOneConversation = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.GETONECONVERSATION,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.getConversationIDBySessionType = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.GETCONVERSATIONIDBYSESSIONTYPE,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.getMultipleConversation = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.GETMULTIPLECONVERSATION,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.deleteConversation = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.DELETECONVERSATION,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.setConversationDraft = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.SETCONVERSATIONDRAFT,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.pinConversation = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.PINCONVERSATION,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.getTotalUnreadMsgCount = function(n) {
					return new Promise(function(r, t) {
						var o = n || a(i.uid);
						i.wsSend({
							reqFuncName: e.GETTOTALUNREADMSGCOUNT,
							operationID: o,
							userID: i.uid,
							data: ""
						}, r, t)
					})
				}, i.getConversationRecvMessageOpt = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.GETCONVERSATIONRECVMESSAGEOPT,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.setConversationRecvMessageOpt = function(n, r) {
					return new Promise(function(o, u) {
						var s = r || a(i.uid),
							E = t({}, n);
						E.conversationIDList = JSON.stringify(n.conversationIDList), i.wsSend({
							reqFuncName: e.SETCONVERSATIONRECVMESSAGEOPT,
							operationID: s,
							userID: i.uid,
							data: E
						}, o, u)
					})
				}, i.searchLocalMessages = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.SEARCHLOCALMESSAGES,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.addFriend = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.ADDFRIEND,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.searchFriends = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.SEARCHFRIENDS,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.getDesignatedFriendsInfo = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.GETDESIGNATEDFRIENDSINFO,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.getRecvFriendApplicationList = function(n) {
					return new Promise(function(r, t) {
						var o = n || a(i.uid);
						i.wsSend({
							reqFuncName: e.GETRECVFRIENDAPPLICATIONLIST,
							operationID: o,
							userID: i.uid,
							data: ""
						}, r, t)
					})
				}, i.getSendFriendApplicationList = function(n) {
					return new Promise(function(r, t) {
						var o = n || a(i.uid);
						i.wsSend({
							reqFuncName: e.GETSENDFRIENDAPPLICATIONLIST,
							operationID: o,
							userID: i.uid,
							data: ""
						}, r, t)
					})
				}, i.getFriendList = function(n) {
					return new Promise(function(r, t) {
						var o = n || a(i.uid);
						i.wsSend({
							reqFuncName: e.GETFRIENDLIST,
							operationID: o,
							userID: i.uid,
							data: ""
						}, r, t)
					})
				}, i.setFriendRemark = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.SETFRIENDREMARK,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.checkFriend = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.CHECKFRIEND,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.acceptFriendApplication = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.ACCEPTFRIENDAPPLICATION,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.refuseFriendApplication = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.REFUSEFRIENDAPPLICATION,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.deleteFriend = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.DELETEFRIEND,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.addBlack = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.ADDBLACK,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.removeBlack = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.REMOVEBLACK,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.getBlackList = function(n) {
					return new Promise(function(r, t) {
						var o = n || a(i.uid);
						i.wsSend({
							reqFuncName: e.GETBLACKLIST,
							operationID: o,
							userID: i.uid,
							data: ""
						}, r, t)
					})
				}, i.inviteUserToGroup = function(n, r) {
					return new Promise(function(o, u) {
						var s = r || a(i.uid),
							E = t({}, n);
						E.userIDList = JSON.stringify(E.userIDList), i.wsSend({
							reqFuncName: e.INVITEUSERTOGROUP,
							operationID: s,
							userID: i.uid,
							data: E
						}, o, u)
					})
				}, i.kickGroupMember = function(n, r) {
					return new Promise(function(o, u) {
						var s = r || a(i.uid),
							E = t({}, n);
						E.userIDList = JSON.stringify(E.userIDList), i.wsSend({
							reqFuncName: e.KICKGROUPMEMBER,
							operationID: s,
							userID: i.uid,
							data: E
						}, o, u)
					})
				}, i.getGroupMembersInfo = function(n, r) {
					return new Promise(function(o, u) {
						var s = r || a(i.uid),
							E = t({}, n);
						E.userIDList = JSON.stringify(E.userIDList), i.wsSend({
							reqFuncName: e.GETGROUPMEMBERSINFO,
							operationID: s,
							userID: i.uid,
							data: E
						}, o, u)
					})
				}, i.getGroupMemberList = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.GETGROUPMEMBERLIST,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.getGroupMemberListByJoinTimeFilter = function(n, r) {
					return new Promise(function(o, u) {
						var s = r || a(i.uid),
							E = t({}, n);
						E.filterUserIDList = JSON.stringify(E.filterUserIDList), i.wsSend({
							reqFuncName: e.GETGROUPMEMBERLISTBYJOINTIMEFILTER,
							operationID: s,
							userID: i.uid,
							data: E
						}, o, u)
					})
				}, i.searchGroupMembers = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid),
							s = {
								reqFuncName: e.SEARCHGROUPMEMBERS,
								operationID: u,
								userID: i.uid,
								data: {
									searchParam: JSON.stringify(n)
								}
							};
						i.wsSend(s, t, o)
					})
				}, i.setGroupApplyMemberFriend = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.SETGROUPAPPLYMEMBERFRIEND,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.setGroupLookMemberInfo = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.SETGROUPLOOKMEMBERINFO,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.getJoinedGroupList = function(n) {
					return new Promise(function(r, t) {
						var o = n || a(i.uid);
						i.wsSend({
							reqFuncName: e.GETJOINEDGROUPLIST,
							operationID: o,
							userID: i.uid,
							data: ""
						}, r, t)
					})
				}, i.createGroup = function(n, r) {
					return new Promise(function(o, u) {
						var s = r || a(i.uid),
							E = t({}, n);
						E.groupBaseInfo = JSON.stringify(E.groupBaseInfo), E.memberList = JSON.stringify(E
							.memberList), i.wsSend({
							reqFuncName: e.CREATEGROUP,
							operationID: s,
							userID: i.uid,
							data: E
						}, o, u)
					})
				}, i.setGroupInfo = function(n, r) {
					return new Promise(function(o, u) {
						var s = r || a(i.uid),
							E = t({}, n);
						E.groupInfo = JSON.stringify(E.groupInfo), i.wsSend({
							reqFuncName: e.SETGROUPINFO,
							operationID: s,
							userID: i.uid,
							data: E
						}, o, u)
					})
				}, i.setGroupMemberNickname = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.SETGROUPMEMBERNICKNAME,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.getGroupsInfo = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.GETGROUPSINFO,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.joinGroup = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.JOINGROUP,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.searchGroups = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.SEARCHGROUPS,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.quitGroup = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.QUITGROUP,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.dismissGroup = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.DISMISSGROUP,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.changeGroupMute = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.CHANGEGROUPMUTE,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.changeGroupMemberMute = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.CHANGEGROUPMEMBERMUTE,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.transferGroupOwner = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.TRANSFERGROUPOWNER,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.getSendGroupApplicationList = function(n) {
					return new Promise(function(r, t) {
						var o = n || a(i.uid);
						i.wsSend({
							reqFuncName: e.GETSENDGROUPAPPLICATIONLIST,
							operationID: o,
							userID: i.uid,
							data: ""
						}, r, t)
					})
				}, i.getRecvGroupApplicationList = function(n) {
					return new Promise(function(r, t) {
						var o = n || a(i.uid);
						i.wsSend({
							reqFuncName: e.GETRECVGROUPAPPLICATIONLIST,
							operationID: o,
							userID: i.uid,
							data: ""
						}, r, t)
					})
				}, i.acceptGroupApplication = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.ACCEPTGROUPAPPLICATION,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.refuseGroupApplication = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.REFUSEGROUPAPPLICATION,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.signalingInvite = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid),
							s = {};
						s.invitation = n, i.wsSend({
							reqFuncName: e.SIGNAL_INGINVITE,
							operationID: u,
							userID: i.uid,
							data: s
						}, t, o)
					})
				}, i.signalingInviteInGroup = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid),
							s = {};
						s.invitation = n, i.wsSend({
							reqFuncName: e.SIGNALINGINVITEINGROUP,
							operationID: u,
							userID: i.uid,
							data: s
						}, t, o)
					})
				}, i.signalingAccept = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.SIGNALINGACCEPT,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.signalingReject = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.SIGNALINGREJECT,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.signalingCancel = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.SIGNALINGCANCEL,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.signalingHungUp = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.SIGNALINGHUNGUP,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.getSubDepartment = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.GETSUBDEPARTMENT,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.getDepartmentMember = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.GETDEPARTMENTMEMBER,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.getUserInDepartment = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.GETUSERINDEPARTMENT,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.getDepartmentMemberAndSubDepartment = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.GETDEPARTMENTMEMBERANDSUBDEPARTMENT,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.getDepartmentInfo = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.GETDEPARTMENTINFO,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.searchOrganization = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid),
							s = n;
						s.input = JSON.stringify(s.input), i.wsSend({
							reqFuncName: e.SEARCHORGANIZATION,
							operationID: u,
							userID: i.uid,
							data: s
						}, t, o)
					})
				}, i.resetConversationGroupAtType = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.RESETCONVERSATIONGROUPATTYPE,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.setGroupMemberRoleLevel = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.SETGROUPMEMBERROLELEVEL,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.setGroupVerification = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.SETGROUPVERIFICATION,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.setGlobalRecvMessageOpt = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.SETGLOBALRECVMESSAGEOPT,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.newRevokeMessage = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.NEWREVOKEMESSAGE,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.findMessageList = function(n, r) {
					return new Promise(function(t, o) {
						var u = r || a(i.uid);
						i.wsSend({
							reqFuncName: e.FINDMESSAGELIST,
							operationID: u,
							userID: i.uid,
							data: n
						}, t, o)
					})
				}, i.wsSend = function(r, t, o) {
					var u, s, E, d;
					if (null == (u = window) || !u.navigator || window.navigator.onLine) {
						// jl修改过: 兼容非h5端的判断逻辑
						// jl ---start
						// 原代码: if ((null == (s = i.ws) ? void 0 : s.readyState) === (null != (E = null == (d = WebSocket) ? void 0 : d.OPEN) ? E : 0))
						// 修改后: if ((null == (s = i.ws) ? void 0 : s.readyState) === state)
						// 注释: 改为非H5端默认为1
						let state = "web" === i.platform ? (null != (E = null == (d = WebSocket) ? void 0 : d.OPEN) ?
							E : 0) : 1
						// ji ---end
						if ((null == (s = i.ws) ? void 0 : s.readyState) === state) {
							"object" == typeof r.data && (r.data = JSON.stringify(r.data));
							var S = {
								oid: r.operationID || a(i.uid),
								mname: r.reqFuncName,
								mrsve: t,
								mrjet: o,
								flag: !1
							};
							i.ws2promise[S.oid] = S;
							var c = function(t) {
								i.lastTime = (new Date).getTime();
								var o = JSON.parse(t.data);
								if (n[o.event.toUpperCase()]) i.emit(o.event, o);
								else {
									r.reqFuncName === e.LOGOUT && (i.logoutFlag = !0, i.ws.close(), i.ws = void 0);
									var a = i.ws2promise[o.operationID];
									a ? (0 === o.errCode ? a.mrsve(o) : a.mrjet(o), delete i.ws2promise[o
											.operationID]) : o.event !== e.SENDMESSAGE && o.event !== e
										.SENDMESSAGENOTOSS || i.emit(n.ONRECVNEWMESSAGEFROMOTHERWEB, o)
								}
							};
							try {
								"web" == i.platform ? (i.ws.send(JSON.stringify(r)), i.ws.onmessage = c) : (i.ws.send({
									data: JSON.stringify(r),
									success: function(e) {
										"uni" === i.platform && void 0 !== i.ws._callbacks && void 0 !==
											i.ws._callbacks.message && (i.ws._callbacks.message = [])
									}
								}), i.onceFlag && (i.ws.onMessage(c), i.onceFlag = !1))
							} catch (e) {
								return void o({
									event: r.reqFuncName,
									errCode: 112,
									errMsg: "no ws conect...",
									data: "",
									operationID: r.operationID || ""
								})
							}
							r.reqFuncName === e.LOGOUT && (i.onceFlag = !0)
						} else o({
							event: r.reqFuncName,
							errCode: 112,
							errMsg: "ws conecting...",
							data: "",
							operationID: r.operationID || ""
						});
					} else o({
						event: r.reqFuncName,
						errCode: 113,
						errMsg: "net work error",
						data: "",
						operationID: r.operationID || ""
					})
				}, i.getPlatform(), i
		}
		s = r, (u = E).prototype = Object.create(s.prototype), u.prototype.constructor = u, i(u, s);
		var d = E.prototype;
		return d.login = function(n) {
			var r = this;
			return new Promise(function(t, i) {
				var o = n.userID,
					a = n.token,
					u = n.platformID,
					s = n.isBatch,
					E = void 0 !== s && s,
					d = n.operationID;
				r.wsUrl = n.url + "?sendID=" + o + "&token=" + a + "&platformID=" + u, r.platformID = u;
				var S = {
						userID: o,
						token: a
					},
					c = {
						event: e.LOGIN,
						errCode: 0,
						errMsg: "",
						data: "",
						operationID: d || ""
					};
				r.createWs(function() {
					r.uid = o, r.token = a, r.isBatch = E, r.iLogin(S, d).then(function(e) {
						r.logoutFlag = !1, r.heartbeat(), t(e)
					}).catch(function(e) {
						c.errCode = e.errCode, c.errMsg = e.errMsg, i(c)
					})
				}, function() {
					c.errCode = 111, c.errMsg = "ws connect close...", r.logoutFlag || Object
						.values(r.ws2promise).forEach(function(e) {
							return e.mrjet({
								event: e.mname,
								errCode: 111,
								errMsg: "ws connect close...",
								data: "",
								operationID: e.oid
							})
						}), i(c)
				}, function(e) {
					console.log(e), c.errCode = 112, c.errMsg = "ws connect error...", i(c)
				}), r.ws || (c.errCode = 112, c.errMsg = "The current platform is not supported...", i(
					c))
			})
		}, d.iLogin = function(n, r) {
			var t = this;
			return new Promise(function(i, o) {
				var u = r || a(t.uid);
				t.wsSend({
					reqFuncName: e.LOGIN,
					operationID: u,
					userID: t.uid,
					data: n,
					batchMsg: t.isBatch ? 1 : 0
				}, i, o)
			})
		}, d.logout = function(n) {
			var r = this;
			return new Promise(function(t, i) {
				var o = n || a(r.uid);
				r.wsSend({
					reqFuncName: e.LOGOUT,
					operationID: o,
					userID: r.uid,
					data: ""
				}, t, i)
			})
		}, d.getPlatform = function() {
			var e = typeof WebSocket,
				n = typeof uni,
				r = typeof wx;
			this.platform = "undefined" === e ? "object" === n && "object" !== r ? "uni" : "object" !== n &&
				"object" === r ? "wx" : "unknow" : "web"
		}, d.createWs = function(e, n, r) {
			var t = this;
			return console.log("start createWs..."), new Promise(function(i, o) {
				var a;
				null == (a = t.ws) || a.close(), t.ws = void 0;
				var u = function() {
					t.iLogin({
						userID: t.uid,
						token: t.token
					}).then(function(e) {
						t.logoutFlag = !1, console.log("iLogin suc..."), t.heartbeat(), i()
					})
				};
				e && (u = e);
				var s = function() {
					console.log("ws close agin:::"), t.logoutFlag || Object.values(t.ws2promise)
						.forEach(function(e) {
							return e.mrjet({
								event: e.mname,
								errCode: 111,
								errMsg: "ws connect close...",
								data: "",
								operationID: e.oid
							})
						})
				};
				n && (s = n);
				var E = function() {};
				if (r && (E = r), "web" === t.platform) return t.ws = new WebSocket(t.wsUrl), t.ws.onclose =
					s, t.ws.onopen = u, void(t.ws.onerror = E);
				var d = "uni" === t.platform ? uni : wx;
				t.ws = d.connectSocket({
					url: t.wsUrl,
					complete: function() {}
				}), t.ws.onClose(s), t.ws.onOpen(u), t.ws.onError(E)
			})
		}, d.reconnect = function() {
			var e = this;
			this.onceFlag || (this.onceFlag = !0), this.lock || (this.lock = !0, this.clearTimer(), this.timer =
				setTimeout(function() {
					e.createWs(), e.lock = !1
				}, 500))
		}, d.clearTimer = function() {
			this.timer && clearTimeout(this.timer)
		}, d.heartbeat = function() {
			var e, n, r, t, i = this;
			console.log("start heartbeat..."), this.clearTimer(), this.worker && o(this.worker);
			try {
				this.worker = (e = function() {
					var e, n, r, t, a, u;
					i.logoutFlag ? i.worker && o(i.worker) : (null == (e = i.ws) ? void 0 : e
							.readyState) === (null != (n = null == (r = WebSocket) ? void 0 : r
								.CONNECTING) ?
							n : 0) || (null == (t = i.ws) ? void 0 : t.readyState) === (null != (a = null ==
							(u = WebSocket) ? void 0 : u.OPEN) ? a : 1) ? (new Date).getTime() - i
						.lastTime < 9e3 || i.getLoginStatus().catch(function(e) {
							return i.reconnect()
						}) : i.reconnect()
				}, n = new Blob([
					"(function (e) {\n      setInterval(function () {\n        this.postMessage(null)\n      }, 10000)\n    })()"
				]), r = window.URL.createObjectURL(n), (t = new Worker(r)).onmessage = e, t)
			} catch (e) {}
		}, E
	}(r);
export {
	n as CbEvents, u as OpenIMSDK, e as RequestFunc, r as emitter, a as uuid
};